home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Commun⁄Network / macworkstation msg ƒ / hdrs / mws.h < prev   
Encoding:
C/C++ Source or Header  |  1989-10-25  |  2.8 KB  |  101 lines  |  [TEXT/KAHL]

  1. /*
  2.  
  3.     This is the header file for the routines in the 
  4.     MacWorkStation Library.
  5.  
  6. */
  7.  
  8. #ifdef XXX_YYY
  9. #include <QuickDraw.h>
  10. #include <DialogMGR.h>
  11. #include <EventMGR.h>
  12. #include <FontMGR.h>
  13. #include <MenuMGR.h>
  14. #include <TextEdit.h>
  15. #include <WindowMGR.h>
  16. #include <EventMGR.h>
  17. #include <PackageMgr.h>
  18. #endif
  19.  
  20. #include "MWS_TLPM.h"
  21.  
  22. #ifdef RUBBISH
  23. pascal void MacsBug() extern 0xA9FF;
  24. #endif
  25.  
  26. /*
  27.  * names get converted to uppercase when converting .o to lightspeed
  28.  * c project
  29.  */
  30. #define TL_Init TL_INIT
  31. #define TL_Open TL_OPEN
  32. #define TL_Close TL_CLOSE
  33. #define TL_Send TL_SEND
  34. #define TL_Receive TL_RECEIVE
  35.  
  36. extern pascal OSErr TL_Init();
  37. extern pascal OSErr TL_Open(short protocol, TPTLParms params);
  38. extern pascal OSErr TL_Close();
  39. extern pascal OSErr TL_Send(long dataLen, Ptr dataPtr, Boolean msgValid);
  40. extern pascal OSErr TL_Receive(long dataMax, long *dataLen, Ptr dataPtr, Boolean *msgValid);
  41.  
  42.     /* Message Classes */
  43.  
  44. #define kCmdAlert        'A'
  45. #define kCmdCursor        'C'
  46. #define kCmdDialog        'D'
  47. #define kCmdFile        'F'
  48. #define kCmdGraphic        'G'
  49. #define kCmdList        'L'
  50. #define kCmdMenu        'M'
  51. #define kCmdProcess        'P'
  52. #define kCmdText        'T'
  53. #define kCmdWindow        'W'
  54. #define kCmdExec        'X'
  55.  
  56.     /* Parameter seperators */
  57.     
  58. #define kMsgNoMark        '\0'
  59. #define kMsgItemMark    ','
  60. #define kMsgParmMark    ';'
  61.  
  62.     /* Indexes into message array */
  63.  
  64. #define kMsgClass        0
  65. #define kMsgID            1
  66. #define kMsgParms        4
  67. #define kMsgMaxData        550
  68.  
  69.     /* Message data structure used by parsing routines */
  70.  
  71. typedef struct {
  72.         long        msgIndex;        /* Index into message */
  73.         long        msgLength;        /* Length of message */
  74.         Boolean        msgValid;        /* TRUE if valid message */
  75.         Boolean        filler;            /* to match Pascal declaration */
  76.         char        msgData[kMsgMaxData];
  77.     } TRMsg, *TPMsg;
  78.     
  79. pascal Boolean Msg_Send(TPMsg msg);
  80. pascal Boolean Msg_CSend(Ptr msg);
  81. pascal Boolean Msg_PSend(StringPtr msg);
  82. pascal Boolean Msg_Receive(TPMsg msg);
  83.  
  84. pascal void Msg_SetEvt(TPMsg msg, OSType classID);
  85. pascal void Msg_SetConst(TPMsg msg, Str255 str, short mark);
  86. pascal void Msg_SetCString(TPMsg msg, char *str, short mark);
  87. pascal void Msg_SetString(TPMsg msg, Str255 str, short mark);
  88. pascal void Msg_SetNumber(TPMsg msg, long num, short mark);
  89. pascal void Msg_SetFlag(TPMsg msg, Boolean flag, short mark);
  90. pascal void Msg_SetRect(TPMsg msg, Rect *frame, short mark);
  91. pascal void Msg_SetBytes(TPMsg msg, Ptr bytes, long len, short mark);
  92.  
  93. pascal Boolean Msg_GetCmd(TPMsg msg, short *class, long *id);
  94. pascal Boolean Msg_GetString(TPMsg msg, Str255 str, short mark);
  95. pascal Boolean Msg_GetNumber(TPMsg msg, long *num, short mark);
  96. pascal Boolean Msg_GetFlag(TPMsg msg, Boolean *flag, short mark);
  97. pascal Boolean Msg_GetPoint(TPMsg msg, Point *pt, short mark);
  98. pascal Boolean Msg_GetRect(TPMsg msg, Rect *frame, short mark);
  99. pascal Boolean Msg_GetSignature(TPMsg msg, OSType *sig, short mark);
  100.  
  101. /* End of MWS.h */